package com.glink.common.contants;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : qiushaoshan
 * @create 2024/6/14 13:59
 */
public enum ErrorCode {

    REQ_SUCCESS("000000", "成功"),
    BUSINESS_EXCEPTION("000500", "业务接口异常"),
    API_REQUEST_FAILED("100000", "接口调用失败"),
    PARAM_JSON_ERROR("200002", "入参JSON格式化失败"),
    VALID_NOTNULL("200003", "必填字段为空"),
    PARAM_ENUM_ERROR("200004", "参数枚举值无效"),
    PARAM_TYPE_ERROR("200005", "参数格式化异常"),
    NUMBER_FORMAT_ERROR("200006", "数字格式化异常"),
    DATE_FORMAT_ERROR("200007", "日期格式化异常"),
    PARAM_DECRYPT_ERROR("200010", "参数解密失败"),
    PARAM_FALSE_ERROR("200011", "参数被篡改"),
    REPEAT_REQUEST_ERROR("200012", "接口重放异常"),
    SQL_EXCUTE_failed("300000", "数据库操作失败"),
    PK_DUPLICATE("300001", "数据库主键重复"),
    SQL_SYNTAX_ERROR("300002", "SQL语句解析失败"),
    PK_NOT_FOUND("300003", "对应的主键不存在"),
    FILE_IMPORT_FAILED("300004", "文件导入失败"),
    FILE_EXPORT_FAILED("300005", "文件导出失败"),
    NETTY_CALL_FAILED("400001", "NETTY远程服务调用失败"),
    REST_CALL_FAILED("400002", "REST服务调用失败"),
    AUTH_UNAUTH_API("400003", "未授权异常"),
    AUTH_UNAUTH_THIRD_API("400004", "第三方未授权"),
    AUTH_UNAUTH_RIGHT_ERROR("400005", "越权访问"),
    AUTH_CHANGE_PASSWORD_ERROR("400006", "需要修改密码"),
    TOKEN_ERROR("400007", "token已过期或错误"),
    REFRESH_TOKEN_ERROR("400008", "refreshToken已过期或错误"),
    OTHER_EXCEPTION("500001", "其它未知错误");
    
    private String value;

    private String desc;

    ErrorCode(String value, String desc) {
        setValue(value);
        setDesc(desc);
    }

    public String getValue() {
        return this.value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getDesc() {
        return this.desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}